package com.cwz.file.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cwz.api.entity.UserFile;
import com.cwz.core.result.R;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * <p>
 * 用户文件表 服务类
 * </p>
 *
 * @author Wen
 * @since 2023-06-28
 */
public interface UserFileService extends IService<UserFile> {
	/**
	 * @Description: 上传文件
	 * @Author: Wen
	 * @param files:
	 * @param pathId:
	 * @return: com.cwz.core.result.R<java.util.Map<java.lang.String,java.lang.Object>>
	 **/
	R<Map<String, Object>> upload(MultipartFile[] files, Long pathId);

	/**
	 * @Description: 下载文件
	 * @Author: Wen
	 * @param fileId:
	 * @param response:
	 * @return: void
	 **/
	void download(Long fileId, HttpServletResponse response);

	/**
	 * @Description: 删除文件
	 * @Author: Wen
	 * @param fileId:
	 * @return: com.cwz.core.result.R<java.lang.Void>
	 **/
	R<Void> deleteFile(Long fileId);

	/**
	 * @Description: 查询用户文件
	 * @Author: Wen
	 * @param pathId:
	 * @param fileName:
	 * @param fileType:
	 * @param pageNum:
	 * @param pageSize:
	 * @return: com.cwz.core.result.R<java.util.Map<java.lang.String,java.lang.Object>>
	 **/
	R<Map<String, Object>> listFile(Long pathId, String fileName, String fileType, Integer pageNum, Integer pageSize);

	/**
	 * @Description: 分享文件
	 * @Author: Wen
	 * @param fileId:
	 * @return: com.cwz.core.result.R<java.lang.String>
	 **/
	R<String> shareFile(Long fileId);
}
